home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
IRIX Base Documentation 1998 November
/
IRIX 6.5.2 Base Documentation November 1998.img
/
usr
/
share
/
catman
/
g_man
/
cat3
/
standard
/
readrgb.z
/
readrgb
Wrap
Text File
|
1998-10-20
|
5KB
|
133 lines
rrrreeeeaaaaddddRRRRGGGGBBBB((((3333GGGG)))) rrrreeeeaaaaddddRRRRGGGGBBBB((((3333GGGG))))
NNNNAAAAMMMMEEEE
rrrreeeeaaaaddddRRRRGGGGBBBB - gets values of specific pixels
CCCC SSSSPPPPEEEECCCCIIIIFFFFIIIICCCCAAAATTTTIIIIOOOONNNN
lllloooonnnngggg rrrreeeeaaaaddddRRRRGGGGBBBB((((nnnn,,,, rrrreeeedddd,,,, ggggrrrreeeeeeeennnn,,,, bbbblllluuuueeee))))
sssshhhhoooorrrrtttt nnnn;;;;
RRRRGGGGBBBBvvvvaaaalllluuuueeee rrrreeeedddd[[[[]]]],,,, ggggrrrreeeeeeeennnn[[[[]]]],,,, bbbblllluuuueeee[[[[]]]];;;;
PPPPAAAARRRRAAAAMMMMEEEETTTTEEEERRRRSSSS
_n expects the number of pixels to be read by the function.
_r_e_d expects the array in which the pixel red values will be stored.
_g_r_e_e_n expects the array in which the pixel green values will be stored.
_b_l_u_e expects the array in which the pixel blue values will be stored.
FFFFUUUUNNNNCCCCTTTTIIIIOOOONNNN RRRREEEETTTTUUUURRRRNNNN VVVVAAAALLLLUUUUEEEE
The returned value of this function is the number of pixels actually
read. A returned function value of 0 indicates an error, namely, that
the starting point is not a valid character position.
DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
rrrreeeeaaaaddddRRRRGGGGBBBB attempts to read up to _n pixel values from the bitplanes in RGB
mode. It reads them into the _r_e_d, _g_r_e_e_n, and _b_l_u_e arrays starting from
the current character position along a single scan line (constant _y) in
the direction of increasing _x. rrrreeeeaaaaddddRRRRGGGGBBBB returns the number of pixels
read, which is the number requested if the starting point is a valid
character position (inside the current viewport). rrrreeeeaaaaddddRRRRGGGGBBBB returns zero
if the starting point is not a valid character position. The values of
pixels read outside of the viewport or screen are undefined.
rrrreeeeaaaaddddRRRRGGGGBBBB updates the current character position to one pixel to the right
of the last one read; the current character position is undefined if the
new position is outside the viewport.
Pixels are read from the currently active framebuffer, as specified by
ddddrrrraaaawwwwmmmmooooddddeeee.
Thus, to read pixel values from the overlay bitplanes, for example,
simply set ddddrrrraaaawwwwmmmmooooddddeeee to OOOOVVVVEEEERRRRDDDDRRRRAAAAWWWW. Use rrrreeeeaaaaddddssssoooouuuurrrrcccceeee to specify the pixel
source within the current framebuffer (backbuffer, frontbuffer, or z-
buffer, for example) from which both rrrreeeeccccttttrrrreeeeaaaadddd and llllrrrreeeeccccttttrrrreeeeaaaadddd take pixel
values.
In RGB double buffer mode, only the back buffer is read by default. On
machines that support it, you can use rrrreeeeaaaaddddssssoooouuuurrrrcccceeee to control which buffer
is read.
The system must be in RGB mode for rrrreeeeaaaaddddRRRRGGGGBBBB to function correctly.
PPPPaaaaggggeeee 1111
rrrreeeeaaaaddddRRRRGGGGBBBB((((3333GGGG)))) rrrreeeeaaaaddddRRRRGGGGBBBB((((3333GGGG))))
SSSSEEEEEEEE AAAALLLLSSSSOOOO
lrectread, readsource, drawmode
NNNNOOOOTTTTEEEESSSS
rrrreeeeaaaaddddRRRRGGGGBBBB should not be used in new development. Rather, pixels should be
read using the high-performance llllrrrreeeeccccttttrrrreeeeaaaadddd command.
This routine is available only in immediate mode.
RGB pixels are written as 24-bit RGB triples. On systems with less than
the full bitplane configuration, the least significant bits of each R, G,
and B value are not used when pixels are read from the framebuffer. This
means that on 8-bit systems, the least significant 5 bits of each RGB
value are not used, and on 12 bitplane systems, the least significant 4
bits are set not used.
On IRIS-4D GT and GTX models, returned bits that do not correspond to
valid bitplanes are undefined. Other models return zero in these bits.
PPPPaaaaggggeeee 2222